use rbatis::rbatis::Rbatis;   
use dashmap::DashMap; 
use async_session::{MemoryStore, Session, SessionStore as _};

lazy_static! {
    pub static ref RB: Rbatis = Rbatis::new();
    pub static ref HashData:DashMap<String, String> = DashMap::new();
    pub static ref SDB:MemoryStore = MemoryStore::new();
}   

pub fn init_db() { 
    log::info!("数据库[连接池]初始化成功！");
    // "mysql://tc:Tcheng#123456@180.138.48.142:21706/aqxx_supervise_rust"  其中的 # 号需要转译为 %23
    RB.init(
        rbdc_mysql::driver::MysqlDriver {},
        "mysql://tc:Tcheng%23123456@180.138.48.142:21706/aqxx_supervise_rust",
        //"mysql://tc:TCdb%23123456@127.0.0.1:3306/aqxx",
    )
    .unwrap();  
    RB.get_pool().unwrap().resize(20);  // 设置连接池连接数

    log::info!("连接池状态 {}", RB.get_pool().unwrap().status().size);
} 
